<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>业务管理 - WMS仓库管理系统</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/business.css">
</head>
<body>
    <div class="container">
        <!-- 登录界面 -->
        <section id="loginSection" class="login-section">
            <div class="login-container">
                <h2>WMS仓库管理系统登录</h2>
                <form id="loginForm">
                    <div class="form-group">
                        <label for="username">用户名:</label>
                        <input type="text" id="username" required>
                    </div>
                    <div class="form-group">
                        <label for="password">密码:</label>
                        <input type="password" id="password" required>
                    </div>
                    <button type="submit" class="btn-primary">登录</button>
                    <p>默认管理员账号: admin / 123456</p>
                </form>
            </div>
        </section>

        <!-- 主内容界面 -->
        <div id="mainContent" class="main-content">
            <header>
                <h1>业务管理</h1>
                <p>管理入库单据、出库单据等业务流程</p>
                <div class="header-actions">
                    <a href="index.html" class="btn-secondary">返回首页</a>
                    <button id="logoutBtn" class="btn-secondary">退出登录</button>
                </div>
            </header>

            <main>
                <nav class="module-nav">
                    <ul>
                        <li><a href="#inbound-documents" class="active">入库单据</a></li>
                        <li><a href="#outbound-documents">出库单据</a></li>
                        <li><a href="#outbound-query">查询出库</a></li>
                        <li><a href="#inventory-query">库存查询</a></li>
                        <li><a href="#stocktaking">盘点管理</a></li>
                        <li><a href="#transfer">移库管理</a></li>
                    </ul>
                </nav>

                <!-- 入库单据 -->
                <section id="inbound-documents" class="module-section active">
                    <h2>入库单据</h2>
                    <button id="addInboundBtn" class="btn-primary">创建入库单据</button>
                    <a href="create_inbound.html" class="btn-primary">新页面创建</a>
                    <div class="table-container">
                        <table id="inboundTable">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>货物ID</th>
                                    <th>供应商</th>
                                    <th>数量</th>
                                    <th>预计到达</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 入库单据数据将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>

                <!-- 出库单据 -->
                <section id="outbound-documents" class="module-section">
                    <h2>出库单据</h2>
                    <button id="addOutboundBtn" class="btn-primary">创建出库单据</button>
                    <a href="create_outbound.html" class="btn-primary">新页面创建</a>
                    <div class="table-container">
                        <table id="outboundTable">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>货物ID</th>
                                    <th>客户</th>
                                    <th>数量</th>
                                    <th>预计提货</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 出库单据数据将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>

                <!-- 查询出库 -->
                <section id="outbound-query" class="module-section">
                    <h2>查询出库</h2>
                    <!-- 查询条件区域 -->
                    <div class="filter-section">
                        <div class="filter-row">
                            <div class="form-group">
                                <label for="queryMaterialName">物料名称:</label>
                                <input type="text" id="queryMaterialName">
                            </div>
                            <div class="form-group">
                                <label for="queryMaterialCode">物料编码:</label>
                                <input type="text" id="queryMaterialCode">
                            </div>
                            <div class="form-group">
                                <label for="queryLocation">货位号:</label>
                                <input type="text" id="queryLocation">
                            </div>
                        </div>
                        <div class="filter-row">
                            <div class="form-group">
                                <label for="queryAisle">选择巷道:</label>
                                <select id="queryAisle">
                                    <option value="">请选择巷道...</option>
                                    <option value="A">A</option>
                                    <option value="B">B</option>
                                    <option value="C">C</option>
                                    <option value="D">D</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="queryRow">选择排:</label>
                                <select id="queryRow">
                                    <option value="">请选择排...</option>
                                    <option value="01">01</option>
                                    <option value="02">02</option>
                                    <option value="03">03</option>
                                    <option value="04">04</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="queryColumn">选择列:</label>
                                <select id="queryColumn">
                                    <option value="">请选择列...</option>
                                    <option value="01">01</option>
                                    <option value="02">02</option>
                                    <option value="03">03</option>
                                    <option value="04">04</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="queryLevel">选择层:</label>
                                <select id="queryLevel">
                                    <option value="">请选择层...</option>
                                    <option value="01">01</option>
                                    <option value="02">02</option>
                                    <option value="03">03</option>
                                    <option value="04">04</option>
                                </select>
                            </div>
                        </div>
                        <div class="filter-row">
                            <div class="form-group">
                                <label for="queryEndEquipment">选择终点设备:</label>
                                <select id="queryEndEquipment">
                                    <option value="">请选择终点设备...</option>
                                    <option value="出口1">出口1</option>
                                    <option value="出口2">出口2</option>
                                    <option value="出口3">出口3</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="queryAisleNumber">巷道号:</label>
                                <select id="queryAisleNumber">
                                    <option value="">请选择巷道号...</option>
                                    <option value="A">A</option>
                                    <option value="B">B</option>
                                    <option value="C">C</option>
                                    <option value="D">D</option>
                                </select>
                            </div>
                        </div>
                        <div class="filter-actions">
                            <button id="queryOutboundSubmitBtn" class="btn-primary">提交</button>
                            <button id="queryOutboundResetBtn" class="btn-secondary">重置</button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table id="outboundQueryTable">
                            <thead>
                                <tr>
                                    <th><input type="checkbox" id="selectAllCheckbox"></th>
                                    <th>序号</th>
                                    <th>货位号</th>
                                    <th>托盘号</th>
                                    <th>物料编码</th>
                                    <th>物料名称</th>
                                    <th>规格型号</th>
                                    <th>单位</th>
                                    <th>数量</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 查询出库数据将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                        <div class="table-actions">
                            <button id="sendInstructionsBtn" class="btn-primary">下发指令</button>
                        </div>
                    </div>
                </section>

                <!-- 库存查询 -->
                <section id="inventory-query" class="module-section">
                    <h2>库存查询</h2>
                    <div class="form-group">
                        <input type="text" id="inventorySearch" placeholder="输入货物名称或SKU进行搜索">
                        <button id="searchInventoryBtn" class="btn-primary">搜索</button>
                    </div>
                    <div class="table-container">
                        <table id="inventoryQueryTable">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>货物名称</th>
                                    <th>SKU</th>
                                    <th>数量</th>
                                    <th>位置</th>
                                    <th>状态</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 库存查询数据将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>

                <!-- 盘点管理 -->
                <section id="stocktaking" class="module-section">
                    <h2>盘点管理</h2>
                    <button id="startStocktakingBtn" class="btn-primary">开始盘点</button>
                    <div class="table-container">
                        <table id="stocktakingTable">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>货物名称</th>
                                    <th>SKU</th>
                                    <th>系统数量</th>
                                    <th>实际数量</th>
                                    <th>差异</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 盘点数据将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>

                <!-- 移库管理 -->
                <section id="transfer" class="module-section">
                    <h2>移库管理</h2>
                    <button id="addTransferBtn" class="btn-primary">创建移库单</button>
                    <div class="table-container">
                        <table id="transferTable">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>货物ID</th>
                                    <th>源货位</th>
                                    <th>目标货位</th>
                                    <th>数量</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 移库数据将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>
            </main>
        </div>

        <!-- 查看入库单据详情模态框 -->
        <div id="viewInboundModal" class="modal">
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>入库单据详情</h2>
                <div id="inboundDetailContent">
                    <!-- 入库单据详情将通过JavaScript动态加载 -->
                </div>
            </div>
        </div>

        <!-- 查看出库单据详情模态框 -->
        <div id="viewOutboundModal" class="modal">
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>出库单据详情</h2>
                <div id="outboundDetailContent">
                    <!-- 出库单据详情将通过JavaScript动态加载 -->
                </div>
            </div>
        </div>

        <!-- 创建移库单模态框 -->
        <div id="addTransferModal" class="modal">
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>创建移库单</h2>
                <form id="addTransferForm">
                    <div class="form-group">
                        <label for="transferGoodsId">货物ID:</label>
                        <input type="number" id="transferGoodsId" required>
                    </div>
                    <div class="form-group">
                        <label for="sourceLocation">源货位:</label>
                        <input type="text" id="sourceLocation" required>
                    </div>
                    <div class="form-group">
                        <label for="targetLocation">目标货位:</label>
                        <input type="text" id="targetLocation" required>
                    </div>
                    <div class="form-group">
                        <label for="transferQuantity">数量:</label>
                        <input type="number" id="transferQuantity" min="1" value="1" required>
                    </div>
                    <button type="submit" class="btn-primary">创建移库单</button>
                </form>
            </div>
        </div>
    </div>

    <script src="js/business.js"></script>
</body>
</html>